# -*- coding: utf-8 -*-
"""
Created on Thu May 17  2024

@author: zhao
"""


import numpy as np
import matplotlib.pyplot as plt
import scienceplots

plt.style.use('science') # 这个需要单独安装
plt.figure(1,dpi=300)  
x=np.linspace(0,1,100)

y1= -np.sqrt(30)*x*(x-1)
y2 = np.sqrt(2) *np.sin(np.pi* x)
plt.plot(x,y1,linewidth = '0.7',label=r'$y= -\sqrt{30} x(x-1)$') 
plt.plot(x,y2,linewidth = '0.7',label=r'$y= \sqrt{2} \sin \pi x$') 
plt.title('Ritz')
plt.xlabel('$x$')
plt.ylabel('$y(x)$')
#plt.legend(loc='upper right')
plt.legend()
name='姚14.2例题3.png'

plt.savefig(name,dpi=300)
plt.show() 